import { useDispatch } from 'umi';

export default () => {
    const dispatch = useDispatch();

    function add() {
        dispatch({
            type: 'useSelector/addNum',
            payload: 1,
        });
    }
    console.log('子节点2 render');
    return (
        <div>
            子节点2
            <button onClick={add}>+</button>
        </div>
    );
};
